# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=vulnerabilities-spider
pkgver=1.426e70f
pkgrel=10
pkgdesc='A tool to scan for web vulnerabilities.'
groups=('blackarch' 'blackarch-webapp' 'blackarch-scanner')
arch=('any')
url='https://github.com/muhammad-bouabid/Vulnerabilities-spider'
license=('custom:unknown')
depends=('python' 'python-beautifulsoup4' 'python-selenium' 'python-requests'
         'python-gobject' 'pygtk' 'python-pymysql' 'gtk3')
makedepends=('git')
source=("$pkgname::git+https://github.com/muhammad-bouabid/Vulnerabilities-spider.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.txt

  rm -rf README.txt

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec python VulnerabilitiesSpider.py "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

